$(function () {
    var transferRecord_datagrid, transferRecord_search,transferRecord_removeAll,transferRecord_remove

    transferRecord_datagrid = $("#transferRecord_datagrid");
    transferRecord_search = $("#searchbtn");
    transferRecord_removeAll = $("#transferRecord_removeAll");
    transferRecord_remove = $("#transferRecord_remove");


    transferRecord_datagrid.datagrid({
        queryParams:{
            statusChange:1
        },
        url: '/formalClientReport/list',
        fit: true,
        fitColumns: true,
        pagination: true,
        singleSelect: true,
        rownumbers: true,
        toolbar:'#datagrid_toolar',
        columns: [[
            {field: 'name', title: '负责人', width: 100,align:'center'},
            {field: 'formalNumber', title: '正式客户增加数量', width: 100,align:'center'}
        ]]

    });

    $("a[data-cmd]").on("click", function () {
        var cmd = $(this).data("cmd");
        cmdObj[cmd]();
    })


    var cmdObj = {


        //刷新
        transferRecord_reload: function () {
            transferRecord_datagrid.datagrid("reload");
        }

    };

    //搜索
    transferRecord_search.textbox({
        buttonText: 'SEARCH',
        prompt: '搜索关键字',
        label: '关键字',
        labelPosition: 'left',
        labelWidth: 50,
        width: 300,
        onClickButton: function () {
            transferRecord_datagrid.datagrid("load", {
                keyword: transferRecord_search.val()
            });
        }
    });


});


